import request from '@/utils/request'

// 获取楼层配置列表
export function listFloorSet(query) {
  return request({
    url: '/setting/floor',
    method: 'get',
    params: query
  })
}

// // 查询协议详细
// export function getAgreement(id) {
//   return request({
//     url: '/agreement/agreement/' + id,
//     method: 'get'
//   })
// }

// 新增楼层配置
export function addFloorSet(data) {
  return request({
    url: '/setting/floor',
    method: 'post',
    data: data
  })
}

// 修改楼层配置
export function updateFloorSet(data) {
  return request({
    url: '/setting/floor',
    method: 'put',
    data: data
  })
}

// 删除楼层配置
export function delFloorSet(ids) {
  return request({
    url: '/setting/sala/' + ids,
    method: 'delete'
  })
}

//修改协议启用状态
export function handleEnabledChange(ids, enabled){
  const data = {
    enabled
  }
  return request({
    url: '/setting/floor/' + ids + '/enabled',
    method: 'put',
    data: data
  })
}
// 楼层卡片列表
export function listFloorCard(params) {
  return request({
    url: '/setting/sala',
    method: 'get',
    params
  })
}
// 新增卡片
export function addFloorCard(data) {
  return request({
    url: '/setting/sala',
    method: 'post',
    data
  })
}
// 编辑卡片
export function editFloorCard(data) {
  return request({
    url: '/setting/sala/'+data.id,
    method: 'put',
    data
  })
}
// 删除卡片
export function delFloorCard(ids) {
  return request({
    url: '/setting/sala/'+ids,
    method: 'delete'
  })
}